<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<jsp:root version="1.2"
      xmlns:jsp="http://java.sun.com/JSP/Page"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:a4j="http://richfaces.org/a4j"
	  xmlns:rich="http://richfaces.org/rich"
	  xmlns:fn="http://java.sun.com/jsp/jstl/functions"
	  xmlns:c="http://java.sun.com/jstl/core"
	  xmlns:p="http://primefaces.prime.com.tr/ui"> 

	<html xmlns="http://www.w3.org/1999/xhtml" >
		<head>
			<title>
				<ui:insert name="title">
					Projeto
				</ui:insert>
			</title>
			<ui:insert name="head">
			</ui:insert>
			<script type="text/javascript">
				var infoWindowAMShown = false;
				var infoWindowAMTimer;
				
				function showModalInfoWindow(){
					infoWindowAMTimer = setTimeout("if(!infoWindowAMShown){Richfaces.showModalPanel('ajaxLoadingModalBox');infoWindowAMShown=true;}", 1);
				}
				
				function hideModalInfoWindow(){
					if (infoWindowAMShown){
						Richfaces.hideModalPanel('ajaxLoadingModalBox');
						infoWindowAMShown=false;
					}else{
						if(infoWindowAMTimer)
							clearTimeout(infoWindowAMTimer);
					}
				}
			</script>
			
			<link id="mainCss" rel="stylesheet" href="/Projeto/css/main.css" type="text/css" />
			<script type="text/javascript" src="/Projeto/js/main.js"></script>
		</head>
		<body>
			<f:view>
				<a4j:status onstart="showModalInfoWindow();" onstop="hideModalInfoWindow()"/>
		   		<rich:modalPanel id="ajaxLoadingModalBox" height="50" width="200" style="text-align:center;">
					<h:outputText value="#{labels['info.aguardeSuaRequisicao']}"/>
				</rich:modalPanel>
					<table width="100%">
						<tr>
							<td style="width:200px;">&nbsp;</td>
							<td>
								<ui:include src="/templates/include/header.xhtml" />
								<rich:panel id="corpoPrincipal" style="min-height: 500px;">
									<a4j:outputPanel ajaxRendered="true">								
										<a4j:form ajaxSubmit="true">
											<h:panelGroup layout="block" rendered="#{not empty userBean.autoridade and not empty bean.breadCrumb}">
												<a4j:repeat value="#{bean.breadCrumb}" var="item" rowKeyVar="index">
													<h:panelGroup layout="block" rendered="#{index == (fn:length(bean.breadCrumb) - 1)}">
														<h:outputText value="#{item}" styleClass="lastBreadCrumb" />
													</h:panelGroup>	
													<h:panelGroup layout="block" rendered="#{index != (fn:length(bean.breadCrumb) - 1)}">
														<h:outputText value="#{item}" />
														<h:outputText value="  >  " />
													</h:panelGroup>
												</a4j:repeat>
												<br />
												<br />
											</h:panelGroup>
										</a4j:form>
										<h:panelGroup layout="block" rendered="#{not empty userBean.autoridade}">
											<br />
											<h:outputText value="#{bean.pageMessage}" styleClass="pageMessage" />
											<br />
											<br />
										</h:panelGroup>
										
										<p:messages id="mensagens" showDetail="true" 
											showSummary="false" globalOnly="true"/>
											
								        <br />
								        
										<ui:insert name="body"/>
									</a4j:outputPanel>					
								</rich:panel>
								<ui:include src="/templates/include/footer.xhtml" />
							</td>
							<td style="width:200px;">&nbsp;</td>
						</tr>
					</table>
			</f:view>
		</body>
	</html>
</jsp:root>